package com.timothy.calculate;

import java.text.NumberFormat;

/**
 * Created by hp on 13-6-2.
 */
public class NumberUtil {

    public static String formatData2Deci(double c) {
        java.text.DecimalFormat myformat = new java.text.DecimalFormat("#0.00");
        return myformat.format(c);
    }

    public static String formatData3Deci(double c) {
        java.text.DecimalFormat myformat = new java.text.DecimalFormat("#0.00");
        return myformat.format(c);
    }

    public static String formatData4Deci(double c) {
        java.text.DecimalFormat myformat = new java.text.DecimalFormat("#0.0000");
        return myformat.format(c);
    }

/*    public static String  getCurrency(double money){
        NumberFormat currencyFormat = NumberFormat.getCurrencyInstance();
        return currencyFormat.format(money);
    }

    public static String  getCurrency(long money){
        NumberFormat currencyFormat = NumberFormat.getCurrencyInstance();
        return currencyFormat.format(money);
    }*/
}
